package resman.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import resman.model.Bean;
import resman.model.UserStatus;

@SuppressWarnings("serial")
@Entity
@Table(name = "Login")
public class LoginBean extends Bean
{
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long loginId;

	@OneToOne(cascade = CascadeType.ALL)
	private ResumeBean resume;

	@Column(unique = true, nullable = false)
	private String email;

	@Column(nullable = false)
	private String password;

	@Enumerated(EnumType.STRING)
	@Column(nullable = false)
	private UserStatus status;

	public LoginBean()
	{
		status = UserStatus.ACTIVE;
	}

	public Long getLoginId()
	{
		return loginId;
	}

	public void setLoginId(Long loginId)
	{
		this.loginId = loginId;
	}

	public ResumeBean getResume()
	{
		return resume;
	}

	public void setResume(ResumeBean resume)
	{
		this.resume = resume;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	public String getPassword()
	{
		return password;
	}

	public void setPassword(String password)
	{
		this.password = password;
	}

	public UserStatus getStatus()
	{
		return status;
	}

	public void setStatus(UserStatus status)
	{
		this.status = status;
	}

}
